import * as API from '../../api'
export default {
  namespaced: true,
  state: {
    playlist: [],
    songListChat: []
  },
  getters: {},
  actions: {
    async getRecommendSongs({ commit }, { ids }) {
      const result = await API.recommendsongs.reqGetRecommendSongs(ids)
      const playlist = result.playlist
      commit('GET_RECOMMEND_SONGS', playlist)
    },
    async getSongListChat({ commit }, { ids }) {
      const result = await API.recommendsongs.reqGetSongListChat(ids)
      const songListChat = result.comments
      commit('GET_SONG_LIST_CHAT', songListChat)
    }
  },
  mutations: {
    GET_RECOMMEND_SONGS(state, playlist) {
      state.playlist = playlist
    },
    GET_SONG_LIST_CHAT(state, songListChat) {
      state.songListChat = songListChat
    }
  }
}
